﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DongFangGuoKai.WMSPlatform.Core.Migrations
{
    public partial class M1 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "t_Action",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ActionCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "操作编码"),
                    ActionName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "操作名称"),
                    Position = table.Column<int>(type: "int", nullable: true, comment: "显示位置 ：1-表单内；2-表单上"),
                    Icon = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "图标"),
                    Method = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "方法名称"),
                    Remark = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "说明"),
                    Status = table.Column<int>(type: "int", nullable: true, comment: "状态：0-禁用；1-启用"),
                    CssClassName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "样式名称"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, comment: "排序号"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人姓名"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改用户名称"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Action", x => x.Id);
                },
                comment: "操作按钮表");

            migrationBuilder.CreateTable(
                name: "t_AgvInstruct",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RequestId = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "请求Id"),
                    RequestUrl = table.Column<string>(type: "varchar(5000)", unicode: false, maxLength: 5000, nullable: true, comment: "请求地址"),
                    RequstBody = table.Column<string>(type: "text", nullable: true, comment: "请求body"),
                    RequstType = table.Column<int>(type: "int", nullable: true, comment: "请求类型"),
                    Respone = table.Column<string>(type: "text", nullable: true, comment: "返回接口"),
                    Success = table.Column<bool>(type: "bit", nullable: true, comment: "是否成功"),
                    RetryTimes = table.Column<int>(type: "int", nullable: true, comment: "重试次数"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "创建人")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_AgvInstruct", x => x.Id);
                },
                comment: "AGV请求指令");

            migrationBuilder.CreateTable(
                name: "t_Area",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: false, comment: "库区编码"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "库区名称"),
                    IsRealArea = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((1))", comment: "是否物理库区"),
                    WhId = table.Column<int>(type: "int", nullable: false, comment: "库房Id"),
                    WhCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "库房编码"),
                    WhName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房名称"),
                    Status = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "状态：0-禁用；1-正常；"),
                    TypeId = table.Column<int>(type: "int", nullable: false, comment: "类型Id"),
                    TypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "类型名称"),
                    ERPCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "对应ERP系统的库区编码"),
                    BuiltArea = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "库区面积"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "排序号"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人"),
                    ShelfCount = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Area", x => x.Id);
                },
                comment: "库区");

            migrationBuilder.CreateTable(
                name: "t_AreaOpen",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    AreaAgvname = table.Column<string>(type: "varchar(150)", unicode: false, maxLength: 150, nullable: true, comment: "库口agv名称"),
                    areastate = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    AreaWCSname = table.Column<string>(type: "varchar(150)", unicode: false, maxLength: 150, nullable: true, comment: "库口wcs名称")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_AreaOpen", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_AuditRecord",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "审核记录Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RecordType = table.Column<int>(type: "int", nullable: false, comment: "记录类型：1-入库单审核；2-出库单审核；4-收货单审核"),
                    RecordId = table.Column<int>(type: "int", nullable: false, comment: "记录Id"),
                    AuditUserId = table.Column<int>(type: "int", nullable: true, comment: "审核人用户Id"),
                    AuditUserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "审核人姓名"),
                    AuditTime = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "审核时间"),
                    AuditStatus = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "审核状态：0:未处理;1:通过;2:未通过"),
                    Remark = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "备注：不通过时，为不通过原因"),
                    AuditUserRealName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "审核用户真实姓名"),
                    ModuleName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_AuditRecord", x => x.Id);
                },
                comment: "审核记录表");

            migrationBuilder.CreateTable(
                name: "t_BarCodeRules",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "自增Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: false, comment: "编码规则名称"),
                    Type = table.Column<int>(type: "int", nullable: false, comment: "类型枚举"),
                    RuleDescription = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "规则描述"),
                    BarCodeRules = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "条码规则"),
                    MaxNumber = table.Column<int>(type: "int", nullable: true, comment: "最大值"),
                    Sample = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "序列号样例"),
                    NumberLength = table.Column<int>(type: "int", nullable: true, comment: "流水号位数"),
                    StartNumber = table.Column<int>(type: "int", nullable: true, comment: "流水号起始"),
                    Number = table.Column<int>(type: "int", nullable: true, comment: "流水号"),
                    IsEnable = table.Column<bool>(type: "bit", nullable: true, comment: "是否启用"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "创建人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人Id"),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "修改人"),
                    Code = table.Column<string>(type: "varchar(5)", unicode: false, maxLength: 5, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_BarCodeRules", x => x.Id);
                },
                comment: "编码规则");

            migrationBuilder.CreateTable(
                name: "t_CachePort",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "编码"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "名称"),
                    AreaType = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "区域类型：1-入库区;2-出库区;3-异常区"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "排序号"),
                    WorkMode = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "作业模式：1-全入；2-全出模式；3-左出右入；4-左入右出。"),
                    IsUsed = table.Column<bool>(type: "bit", nullable: false, comment: "是否有货"),
                    Status = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "状态：0-禁用；1-启用；"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人"),
                    StackingStorageId = table.Column<int>(type: "int", nullable: true, comment: "当前缓存口占用垛信息")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_CachePort", x => x.Id);
                },
                comment: "缓存口");

            migrationBuilder.CreateTable(
                name: "t_Carrier",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: false, comment: "承运商编码"),
                    Name = table.Column<string>(type: "varchar(128)", unicode: false, maxLength: 128, nullable: false, comment: "承运商名称"),
                    TypeId = table.Column<int>(type: "int", nullable: true, comment: "分类Id:对应字典项Id"),
                    TypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "分类名称：对应字典项名称"),
                    AddrDetail = table.Column<string>(type: "varchar(128)", unicode: false, maxLength: 128, nullable: true, comment: "承运商地址"),
                    Contact = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "联系人"),
                    ContactMobile = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "联系电话"),
                    Contact1 = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "联系人1"),
                    Contact1Mobile = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "联系人1电话"),
                    Fax = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "传真"),
                    Email = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "邮箱"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, comment: "排序号"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建用户Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建用户名"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "创建用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建用户名称")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Carrier", x => x.Id);
                },
                comment: "承运商");

            migrationBuilder.CreateTable(
                name: "t_Cell",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: false, comment: "仓位编码"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "仓位名称"),
                    CellType = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))"),
                    WhId = table.Column<int>(type: "int", nullable: false, comment: "库房Id"),
                    WhCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    WhName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    AreaId = table.Column<int>(type: "int", nullable: false, comment: "库区Id"),
                    AreaCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    AreaName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    RoutewayId = table.Column<int>(type: "int", nullable: false, comment: "巷道Id"),
                    ShelfId = table.Column<int>(type: "int", nullable: false, comment: "货架Id"),
                    ShelfCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "货架编码"),
                    ShelfName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货架名称"),
                    Status = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "状态：0-禁用；1-正常"),
                    LineNO = table.Column<int>(type: "int", nullable: false, comment: "排号"),
                    LayerNO = table.Column<int>(type: "int", nullable: false, comment: "层号"),
                    ColumnNO = table.Column<int>(type: "int", nullable: false, comment: "列号"),
                    DepthIndex = table.Column<int>(type: "int", nullable: false, comment: "深度：0:代表一深位、1:代表二深位、2:代表三深位、3:代表四深位；当项目用不上深度时，该值赋值0"),
                    IsMaxDepth = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((1))", comment: "是否为最深度的仓位"),
                    ERPCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "ERP仓位编码"),
                    BusinessType = table.Column<int>(type: "int", nullable: false, comment: "当前业务类型：0-无；1-入库；2-出库；3-盘点；"),
                    IsLock = table.Column<bool>(type: "bit", nullable: false, comment: "是否锁定"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人"),
                    FullStatus = table.Column<int>(type: "int", nullable: false, comment: "满仓状态：0-空仓；1-满仓；2-不满仓"),
                    DistanceValue = table.Column<decimal>(type: "decimal(18,13)", nullable: false),
                    LogicalPartCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    LogicalPartName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    HeightType = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((3))")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Cell", x => x.Id);
                },
                comment: "仓位");

            migrationBuilder.CreateTable(
                name: "t_Company",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: false, comment: "公司编码"),
                    Name = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: false, comment: "公司名称"),
                    TypeId = table.Column<int>(type: "int", nullable: true, comment: "分类Id：对应字典项Id"),
                    TypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "分类名称：对应字典项名称"),
                    AddrDetail = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: true, comment: "公司地址"),
                    Contact = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "联系人"),
                    Tel = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "联系电话"),
                    ContactMobile = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "联系人手机号"),
                    Email = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "联系人邮箱"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "排序号"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人名称"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改用户名称")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Company", x => x.Id);
                },
                comment: "公司");

            migrationBuilder.CreateTable(
                name: "t_Customer",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: false, comment: "客户编码"),
                    Name = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: false, comment: "客户名称"),
                    TypeId = table.Column<int>(type: "int", nullable: false, comment: "客户分类Id:对应字典项Id"),
                    TypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "分类名称：对应字典项名称"),
                    AddrDetail = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true, comment: "客户地址"),
                    ResponsiblePerson = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "责任人"),
                    Tel = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "电话"),
                    MobilePhone = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "手机号"),
                    Contact = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "联系人1"),
                    ContactMobile = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "联系人1手机"),
                    Email = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "邮箱"),
                    ContractNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "合同号"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "排序号"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建用户Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建用户名"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改用户名称")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Customer", x => x.Id);
                },
                comment: "客户");

            migrationBuilder.CreateTable(
                name: "t_Department",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DepartmentCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "部门代码"),
                    DepartmentName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "部门名称"),
                    ParentId = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "上级部门Id"),
                    Contact = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "联系人"),
                    ContactMobile = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "联系电话"),
                    Status = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建用户Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建用户名"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "创建用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建用户名称")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Department", x => x.Id);
                },
                comment: "部门");

            migrationBuilder.CreateTable(
                name: "t_DepartmentOwner",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DepartmentId = table.Column<int>(type: "int", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_DepartmentOwner", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_Device",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "设备Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: false, comment: "设备编码"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "设备名称"),
                    DeviceType = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "设备类型：1-AGV"),
                    Status = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "状态：0-禁用；1-正常；2-异常"),
                    ExceptionMsg = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "异常说明"),
                    ExceptionDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "异常时间"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人"),
                    WarehouseCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Device", x => x.Id);
                },
                comment: "设备");

            migrationBuilder.CreateTable(
                name: "t_DictItem",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TypeId = table.Column<int>(type: "int", nullable: false, comment: "分类Id"),
                    ItemName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "项名称"),
                    ItemCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "项编码"),
                    ItemValue = table.Column<int>(type: "int", nullable: false, comment: "项值"),
                    ParentId = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "父级Id"),
                    LevelIndex = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "层级"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "排序号"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人姓名"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改用户名称"),
                    IsEnd = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((1))"),
                    TypeCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    IsDefault = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_DictItem", x => x.Id);
                },
                comment: "字典项");

            migrationBuilder.CreateTable(
                name: "t_DictType",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TypeCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: false, comment: "类型编码"),
                    TypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "类型名称"),
                    IsTree = table.Column<bool>(type: "bit", nullable: false, comment: "是否树形结构"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "排序号"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人姓名"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改用户名称")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_DictType", x => x.Id);
                },
                comment: "数据字典");

            migrationBuilder.CreateTable(
                name: "t_DisasterLevel",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "自增Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "名称"),
                    Type = table.Column<int>(type: "int", nullable: true, comment: "类型"),
                    Season = table.Column<int>(type: "int", nullable: true, comment: "季节"),
                    Level = table.Column<int>(type: "int", nullable: true, comment: "等级"),
                    Remark = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "说明"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人ID"),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "创建人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人Id"),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "修改人")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_DisasterLevel", x => x.Id);
                },
                comment: "灾情等级");

            migrationBuilder.CreateTable(
                name: "t_DisasterMaterial",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "自增Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物资Id"),
                    MaterialName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "物资名称"),
                    MaterialCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "物资编码"),
                    OutQuantity = table.Column<int>(type: "int", nullable: true, comment: "出库数量"),
                    DisasterLevelId = table.Column<int>(type: "int", nullable: true, comment: "灾情等级")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_DisasterMaterial", x => x.Id);
                },
                comment: "灾情物资");

            migrationBuilder.CreateTable(
                name: "t_ErrorLog",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "自增ID")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Type = table.Column<int>(type: "int", nullable: true, comment: "0：Wms，1:PDA，2WMS"),
                    RequestUrl = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "请求地址"),
                    RequestBody = table.Column<string>(type: "text", nullable: true, comment: "请求内容"),
                    Response = table.Column<string>(type: "text", nullable: true, comment: "请求返回"),
                    ErrorExcetionMsg = table.Column<string>(type: "text", nullable: true, comment: "异常消息"),
                    IP = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "IP地址"),
                    HostName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "电脑名称"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_ErrorLog", x => x.Id);
                },
                comment: "异常日志");

            migrationBuilder.CreateTable(
                name: "t_Instruct",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "指令Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WarehouseCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    StackingStorageId = table.Column<int>(type: "int", nullable: true, comment: "垛入库存储Id"),
                    Status = table.Column<int>(type: "int", nullable: false, comment: "指令状态：0-创建，1-待执行，2-执行中，3-搬运完成，4-处理完成，5-执行异常，6-已强制取消任务"),
                    InstructType = table.Column<int>(type: "int", nullable: false, comment: "指令类型：1-上架、2-下架、3-移位、4-盘点指令"),
                    WorkDeviceType = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "工作设备类型：1-线体;2-AGV"),
                    Action = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((0))"),
                    Priority = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "指令优先级"),
                    FromLocation = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "源位置：可以是货位或者站台编号"),
                    ExpectedToLocation = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "预计目的地址"),
                    ToLocation = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "实际目标位置"),
                    QTY = table.Column<decimal>(type: "decimal(18,3)", nullable: false, comment: "任务数量"),
                    FinishedQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))"),
                    PalletBarcode = table.Column<string>(type: "varchar(128)", unicode: false, maxLength: 128, nullable: true, comment: "按项目需求，客户定制的垛条码"),
                    ScanedBarcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "WCS上报的扫描到的条码，可能与垛号不一样，用于指令完成快速查询"),
                    InstructIndex = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "指令执行顺序"),
                    StartTime = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "指令开始时间"),
                    EndTime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "指令完成时间"),
                    IsSendSuccess = table.Column<bool>(type: "bit", nullable: true),
                    RelatedOrderId = table.Column<int>(type: "int", nullable: true),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true),
                    DeviceCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    FromRoutewayId = table.Column<int>(type: "int", nullable: true),
                    BusinessType = table.Column<int>(type: "int", nullable: false, comment: "业务类型"),
                    BusinessGroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, defaultValueSql: "(newid())", comment: "业务分组Id"),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    RefCellCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    IsSuspend = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    LogicalCellAddr = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true),
                    BusinessGroupId2 = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Instruct", x => x.Id);
                },
                comment: "指令记录");

            migrationBuilder.CreateTable(
                name: "t_InterfaceLog",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "Id主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "接口名称"),
                    Url = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "接口地址"),
                    CallWay = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "请求方式：1-Get;2-Post"),
                    InParam = table.Column<string>(type: "text", nullable: true, comment: "入参"),
                    OutParam = table.Column<string>(type: "text", nullable: true, comment: "出参"),
                    Status = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "状态：0-待执行；1-成功；2-验证失败；3-执行失败"),
                    CallMillisecond = table.Column<int>(type: "int", nullable: true, comment: "请求耗时毫秒数"),
                    ExecMillisecond = table.Column<int>(type: "int", nullable: true, comment: "执行耗时毫秒数"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ExecDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "执行时间"),
                    FinishedDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "完成时间"),
                    ReExecTimes = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "重复执行次数"),
                    RefTaskId = table.Column<int>(type: "int", nullable: true, comment: "关联任务Id"),
                    RefInstructId = table.Column<int>(type: "int", nullable: true, comment: "关联指令Id"),
                    ErrorMsg = table.Column<string>(type: "varchar(400)", unicode: false, maxLength: 400, nullable: true, comment: "错误信息"),
                    ExecBusinessCalss = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    LogType = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))"),
                    Direction = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_InterfaceLog", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_Inventory",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WarehouseId = table.Column<int>(type: "int", nullable: true, comment: "库房Id"),
                    WarehouseCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房名称"),
                    AreaId = table.Column<int>(type: "int", nullable: true, comment: "库区Id"),
                    AreaCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    AreaName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库区名称"),
                    LocationId = table.Column<int>(type: "int", nullable: true, comment: "仓位Id"),
                    LocationCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "仓位编码"),
                    LocationDepth = table.Column<int>(type: "int", nullable: false, comment: "垛所在仓位深度"),
                    LocationLineNO = table.Column<int>(type: "int", nullable: false, comment: "排号"),
                    LocationLayerNO = table.Column<int>(type: "int", nullable: false, comment: "层号"),
                    LocationColumnNO = table.Column<int>(type: "int", nullable: false, comment: "列号"),
                    LocationName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    LocationHeightType = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "库存状态：1-正常库存；2-转移中的库存；3-入库在途；4-出库在途；5-限制使用的库存;6-异常库存;7-预分配库存;8-冻结库存"),
                    PalletBarcode = table.Column<string>(type: "varchar(128)", unicode: false, maxLength: 128, nullable: true, comment: "垛条码"),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true, comment: "关联详情单Id"),
                    BillType = table.Column<int>(type: "int", nullable: true, comment: "单据类型Id"),
                    IsLock = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))", comment: "是否锁定：false-未锁定；true-锁定"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "备注"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料号"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    HasSkuDetail = table.Column<bool>(type: "bit", nullable: false, comment: "是否有货号详情"),
                    AvailableQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "可用库存数量"),
                    AllocateQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "已分配数量"),
                    PutawayQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "上架数量"),
                    PickedQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "下架数量"),
                    UnitId = table.Column<int>(type: "int", nullable: true, comment: "基本单位Id"),
                    UnitName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "基本单位"),
                    PackQTY = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "包装数量"),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true, comment: "物料批次信息Id"),
                    InStockDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "入库时间"),
                    QualityState = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "质量状态：0-待检；1-合格；2-不合格；"),
                    BatchNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id"),
                    OwnerName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货主"),
                    ExpireDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "有效时间"),
                    ProductDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "生产日期"),
                    SupplierId = table.Column<int>(type: "int", nullable: true, comment: "供应商Id"),
                    SupplierName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "供应商"),
                    MaterialTypeId = table.Column<int>(type: "int", nullable: true, comment: "物料类型Id"),
                    MaterialTypeCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    MaterialTypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料类型"),
                    ProduceFactory = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    OutFactoryDate = table.Column<DateTime>(type: "datetime", nullable: true),
                    QADate = table.Column<DateTime>(type: "datetime", nullable: true),
                    ERPLocationCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    RoutewayId = table.Column<int>(type: "int", nullable: true),
                    StackingStorageId = table.Column<int>(type: "int", nullable: true),
                    DeptCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "部门编码"),
                    DeptName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "部门名称"),
                    BusinessType = table.Column<int>(type: "int", nullable: false, comment: "当前业务类型"),
                    LocationDistanceValue = table.Column<decimal>(type: "decimal(18,13)", nullable: true),
                    LogicalPartCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    RealHeightType = table.Column<int>(type: "int", nullable: true, comment: "垛实际高度类型"),
                    DisOrderNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "发货单号"),
                    DisOrderLineNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "发货单行号"),
                    InStockShortDate = table.Column<int>(type: "int", nullable: true),
                    WoodPalletBarcode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    PurOrderNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    PurOrderLineNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    PurOrderLineType = table.Column<int>(type: "int", nullable: true),
                    IsMultPallet = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    MultPalletId = table.Column<int>(type: "int", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(12,2)", nullable: true),
                    MaterialCategoryId = table.Column<int>(type: "int", nullable: true),
                    MaterialCategoryName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true),
                    BatchNoExplain = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true),
                    Price = table.Column<decimal>(type: "decimal(12,2)", nullable: true),
                    ParentPalletBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Inventory", x => x.Id);
                },
                comment: "库存表");

            migrationBuilder.CreateTable(
                name: "t_InventoryAdjust",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "ID")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BillSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "单据号"),
                    SourceType = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "来源单据类型：0-无；10-盘点单；20-手工创建；"),
                    SourceSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "来源单据号\r\n"),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id\r\n"),
                    OwnerName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货主"),
                    WhId = table.Column<int>(type: "int", nullable: true, comment: "仓库Id"),
                    WhName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房名称"),
                    AreaId = table.Column<int>(type: "int", nullable: true, comment: "库区Id"),
                    AreaName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库区名称\r\n"),
                    LocationId = table.Column<int>(type: "int", nullable: true, comment: "仓位Id"),
                    LocationCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "仓位编码"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id\r\n"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料号"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称\r\n"),
                    Qty = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "调整数量\r\n"),
                    Status = table.Column<int>(type: "int", nullable: true, comment: "状态：0-创建；10-已审核；20-已调整；30-取消作废；"),
                    Reason = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "调整原因\r\n"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "备注"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    PalletBarcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true),
                    StocktakeResultId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_InventoryAdjust", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_InventoryDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "库存明细Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    InventoryId = table.Column<int>(type: "int", nullable: false, comment: "库存Id"),
                    Barcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货品条码"),
                    PackageBarcode = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: true, comment: "包装条码"),
                    PalletBarcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "垛条码"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    IsOut = table.Column<bool>(type: "bit", nullable: false),
                    SkuNum = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))"),
                    IsSku = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((1))"),
                    BarcodeRange = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(12,2)", nullable: true),
                    Price = table.Column<decimal>(type: "decimal(12,2)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_InventoryDetail", x => x.Id);
                },
                comment: "库存明细");

            migrationBuilder.CreateTable(
                name: "t_InventoryLog",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "编号")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SourceType = table.Column<int>(type: "int", nullable: true, comment: "来源单据类型：10:-入库；20-出库；30-盘点；40-手工调整；50-库存调整；"),
                    SourceSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "来源单号"),
                    WarehouseId = table.Column<int>(type: "int", nullable: true, comment: "仓库Id"),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "仓库名称"),
                    AreaId = table.Column<int>(type: "int", nullable: true, comment: "库区ID"),
                    AreaName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库区"),
                    LocationCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "仓位"),
                    PalletBarcode = table.Column<string>(type: "varchar(128)", unicode: false, maxLength: 128, nullable: true, comment: "托盘号"),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id"),
                    OwnerName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货主名称"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true, comment: "物料编码"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    BatchNo = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "批次号"),
                    StartQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "原始数量"),
                    ChangeQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "变更数量"),
                    EndQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "最终数量"),
                    BaseUnitId = table.Column<int>(type: "int", nullable: true, comment: "基本单元Id"),
                    BaseUnitName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "单位名称"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "备注"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "生成日期"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人"),
                    CreateUser = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_InventoryLog", x => x.Id);
                },
                comment: "库存流水");

            migrationBuilder.CreateTable(
                name: "t_InventoryPallet",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WhId = table.Column<int>(type: "int", nullable: true, comment: "WhId"),
                    WhName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房名称"),
                    AreaId = table.Column<int>(type: "int", nullable: true, comment: "库区Id"),
                    AreaName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库区名称"),
                    LocationId = table.Column<int>(type: "int", nullable: true, comment: "仓位Id"),
                    LocationCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "仓位编码"),
                    TypeId = table.Column<int>(type: "int", nullable: true, comment: "库存类型Id"),
                    TypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库存类型"),
                    MaterialTypeId = table.Column<int>(type: "int", nullable: true, comment: "物料类型Id"),
                    MaterialTypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料类型"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料号"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    PalletBarcode = table.Column<string>(type: "varchar(128)", unicode: false, maxLength: 128, nullable: true, comment: "垛条码"),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id"),
                    OwnerName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货主"),
                    Qty = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "库存数量"),
                    BaseUnitId = table.Column<int>(type: "int", nullable: true, comment: "基本单位Id"),
                    BaseUnitName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "基本单位"),
                    SupplierId = table.Column<int>(type: "int", nullable: true, comment: "供应商Id"),
                    SupplierName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "供应商"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_InventoryPallet", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_Inventoryst",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    vessel = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "容器编号"),
                    suppliesnode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料编号"),
                    suppliesname = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    barCode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "托盘码"),
                    Cellcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "仓位编码"),
                    Number = table.Column<int>(type: "int", nullable: true, comment: "数量"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人"),
                    CreateUserName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "创建人名称")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Inventoryst", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_Location",
                columns: table => new
                {
                    Code = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
                    Layer = table.Column<int>(type: "int", nullable: true),
                    PriorityIn = table.Column<int>(type: "int", nullable: true),
                    PriorityOut = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    FullStatus = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    Entrance = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    Qy = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    Qe = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                });

            migrationBuilder.CreateTable(
                name: "t_Log",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    LogType = table.Column<int>(type: "int", nullable: false, comment: "日志类型"),
                    ActionType = table.Column<int>(type: "int", nullable: true, comment: "操作类型：0-其他；1-登录；2-退出；3-访问；4-新增；5-删除；6-修改；7-提交；8-审核通过；9-审核拒绝；"),
                    RecordType = table.Column<int>(type: "int", nullable: true, comment: "记录类型"),
                    RecordId = table.Column<int>(type: "int", nullable: true, comment: "记录Id"),
                    UserName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "操作用户名"),
                    RealName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "操作用户真实姓名"),
                    ModuleName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "日志模块"),
                    Description = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "日志描述"),
                    IPAddress = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "IP地址"),
                    IpAddressName = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true, comment: "IP所在地"),
                    Status = table.Column<int>(type: "int", nullable: true, comment: "状态"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    UserId = table.Column<int>(type: "int", nullable: true),
                    UserRemark = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "用户备注")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Log", x => x.Id);
                },
                comment: "日志表");

            migrationBuilder.CreateTable(
                name: "t_Material",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "物料Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    Name = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: false, comment: "物料名称"),
                    ModelSpec = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "型号规格"),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id"),
                    OwnerName = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    TypeId = table.Column<int>(type: "int", nullable: true, comment: "物料类型Id"),
                    TypeCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    TypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料类型"),
                    FullTypeIds = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    FullTypeNames = table.Column<string>(type: "varchar(300)", unicode: false, maxLength: 300, nullable: true),
                    UnitId = table.Column<int>(type: "int", nullable: true, comment: "基本单位Id"),
                    UnitName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "基本单位"),
                    GrossWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "毛重"),
                    NetWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "净重"),
                    GrossWeightUnitId = table.Column<int>(type: "int", nullable: true, comment: "毛重重量单位Id"),
                    GrossWeightUnitName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "毛重重量单位"),
                    NetWeightUnitId = table.Column<int>(type: "int", nullable: true, comment: "净重重量单位Id"),
                    NetWeightUnitName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "净重重量单位"),
                    Volum = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "体积"),
                    VolumUnitId = table.Column<int>(type: "int", nullable: true, comment: "体积单位Id"),
                    VolumUnitName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "体积单位"),
                    MinSafetyStock = table.Column<int>(type: "int", nullable: true, comment: "最小安全库存"),
                    MaxSafetyStock = table.Column<int>(type: "int", nullable: true, comment: "最大安全库存"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "描述"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    Img = table.Column<string>(type: "varchar(255)", unicode: false, maxLength: 255, nullable: true),
                    MaterialCategoryId = table.Column<int>(type: "int", nullable: true),
                    HasSkuDetail = table.Column<bool>(type: "bit", nullable: true),
                    MaterialGroupId = table.Column<int>(type: "int", nullable: true),
                    IsNeedCharging = table.Column<bool>(type: "bit", nullable: true),
                    ExpirationMonth = table.Column<int>(type: "int", nullable: true),
                    MaterialCategoryName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    IsDismantle = table.Column<bool>(type: "bit", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Material", x => x.Id);
                },
                comment: "物料");

            migrationBuilder.CreateTable(
                name: "t_MaterialBarcode",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    Barcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "条码号")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_MaterialBarcode", x => x.Id);
                },
                comment: "物料条码");

            migrationBuilder.CreateTable(
                name: "t_MaterialCategory",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "自增ID")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "分类名称"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "备注"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "创建人姓名"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
                    UpdateUserId = table.Column<int>(type: "int", nullable: true, comment: "更新人Id"),
                    UpdateUserName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "更新人姓名"),
                    UpdateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "更新时间"),
                    ParentId = table.Column<int>(type: "int", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: true),
                    Code = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_MaterialCategory", x => x.Id);
                },
                comment: "物料分类表");

            migrationBuilder.CreateTable(
                name: "t_MaterialExtData",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "数据Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    FieldId = table.Column<int>(type: "int", nullable: false, comment: "扩展字段Id"),
                    FieldName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "字段名称"),
                    MaterialId = table.Column<int>(type: "int", nullable: false),
                    ControlType = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "字段控件类型：1-文本框；2-单选框；3-多选框；4-下拉框；5-多行文本框；6-时间控件"),
                    InputWay = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "输入方式：0-手动输入或选择；1-绑定数据源"),
                    IsTree = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))", comment: "是否下拉树"),
                    BindDictTypeId = table.Column<int>(type: "int", nullable: true, comment: "对应字典类型Id，仅数据绑定下拉框用"),
                    FieldData = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    FieldValues = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "排序"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    FieldCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_MaterialExtData", x => x.Id);
                },
                comment: "物料扩展数据表");

            migrationBuilder.CreateTable(
                name: "t_MaterialExtField",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "扩展字段Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TypeId = table.Column<int>(type: "int", nullable: false, comment: "分类Id"),
                    TypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "分类名称"),
                    FullTypeIds = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true, comment: "全分类Id,包括父级分类"),
                    FullTypeNames = table.Column<string>(type: "varchar(300)", unicode: false, maxLength: 300, nullable: true, comment: "分类全名，包括父分类"),
                    FieldCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "字段编码"),
                    FieldName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "字段名称"),
                    IsRequired = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))", comment: "是否必填"),
                    ControlType = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "字段控件类型：1-文本框；2-单选框；3-多选框；4-下拉框；5-多行文本框；6-时间控件"),
                    InputWay = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "输入方式：0-手动输入或选择；1-绑定数据源"),
                    InputValues = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "可选择内容列表，仅手动选择下拉框用；例1-分类1;2-分类2"),
                    IsTree = table.Column<bool>(type: "bit", nullable: false, comment: "是否树形下拉"),
                    BindDictTypeId = table.Column<int>(type: "int", nullable: true, comment: "对应字典类型Id，仅数据绑定下拉框用"),
                    BindDictTypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "对应字典类型名称，仅数据绑定下拉框用"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "排序"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_MaterialExtField", x => x.Id);
                },
                comment: "物料扩展字段表");

            migrationBuilder.CreateTable(
                name: "t_MaterialGroup",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "自增Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: false, comment: "物料组编码"),
                    Name = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料组名称"),
                    Describe = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "描述"),
                    AreaId = table.Column<int>(type: "int", nullable: true, comment: "存储区 预留字段"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "创建人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人Id"),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "修改人")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_MaterialGroup", x => x.Id);
                },
                comment: "物料组");

            migrationBuilder.CreateTable(
                name: "t_MaterialKey",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    BatchNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "批次号"),
                    QualityState = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "质量状态：0-待检；1-合格；2-不合格；"),
                    SupplierId = table.Column<int>(type: "int", nullable: true, comment: "供应商Id"),
                    SupplierName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "供应商"),
                    ProduceFactory = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "生产厂家"),
                    ProductDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "生产日期"),
                    OutFactoryDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "出厂日期"),
                    ExpireDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "有效期"),
                    QADate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "质检日期"),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id"),
                    OwnerName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货主"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    DeptCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "部门编码"),
                    DeptName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "部门名称"),
                    ContractNO = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: true, defaultValueSql: "('')", comment: "合同号"),
                    MBLNR = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料凭证号"),
                    MJAHR = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料凭证年度"),
                    ZEILE = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料凭证行项目"),
                    PurOrderNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "采购订单号"),
                    PurOrderLineNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "采购订单行号"),
                    PurOrderLineType = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "采购订单行项目类型：0-无；1-L外协；2-U转储;3-正常采购"),
                    ProOrderNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "生产订单号"),
                    OutOrderNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_MaterialKey", x => x.Id);
                },
                comment: "物料批次表");

            migrationBuilder.CreateTable(
                name: "t_MaterialPackage",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialId = table.Column<int>(type: "int", nullable: false, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "物料号"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    BaseUnitId = table.Column<int>(type: "int", nullable: true, comment: "基本单位Id"),
                    BaseUnitName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "基本单位"),
                    PackageUnitId = table.Column<int>(type: "int", nullable: true, comment: "主包装单位Id"),
                    PackageUnitName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "主包装单位"),
                    SubPackageUnitId = table.Column<int>(type: "int", nullable: true, comment: "子包装单位Id"),
                    SubPackageUnitName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "子包装单位"),
                    FactorBU = table.Column<int>(type: "int", nullable: true, comment: "总计量数"),
                    ConversionFactor = table.Column<int>(type: "int", nullable: true, comment: "包装数量"),
                    UOMQty = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "计量数量"),
                    PackageLevel = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "包装等级：1-基本包装;2-二级包装；3-三级包装"),
                    Length = table.Column<int>(type: "int", nullable: true, comment: "长"),
                    Width = table.Column<int>(type: "int", nullable: true, comment: "宽"),
                    Height = table.Column<int>(type: "int", nullable: true, comment: "高"),
                    Weight = table.Column<int>(type: "int", nullable: true, comment: "重量"),
                    Volumn = table.Column<int>(type: "int", nullable: true, comment: "体积"),
                    Remark = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "包装描述"),
                    EquipType = table.Column<string>(type: "varchar(10)", unicode: false, maxLength: 10, nullable: true),
                    EquipTypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_MaterialPackage", x => x.Id);
                },
                comment: "物料包装");

            migrationBuilder.CreateTable(
                name: "t_MaterialWiki",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "自增Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialId = table.Column<int>(type: "int", nullable: false, comment: "物料Id"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: false, comment: "物料名称"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料编码"),
                    Title = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "标题"),
                    Describe = table.Column<string>(type: "text", nullable: true, comment: "描述"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "说明"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "创建人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人Id"),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "修改人")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_MaterialWiki", x => x.Id);
                },
                comment: "物料知识库");

            migrationBuilder.CreateTable(
                name: "t_MaterialWikiFile",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "自增Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialWikiId = table.Column<int>(type: "int", nullable: false, comment: "物料知识库Id"),
                    FileType = table.Column<int>(type: "int", nullable: false, comment: "文件类型，0:图片1:文件"),
                    FileUrl = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "文件路径"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "说明"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "创建人"),
                    FileName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_MaterialWikiFile", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_Menu",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MenuName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "菜单名称"),
                    MenuUrl = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true, comment: "菜单地址"),
                    MenuIcon = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "菜单图标"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: true, comment: "排序号"),
                    ParentId = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "父菜单Id"),
                    Status = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "状态：0-禁用；1-启用"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "创建人姓名"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "修改用户名称"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    IsMobile = table.Column<bool>(type: "bit", nullable: false, comment: "是否移动端")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Menu", x => x.Id);
                },
                comment: "菜单表");

            migrationBuilder.CreateTable(
                name: "t_MenuAction",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MenuId = table.Column<int>(type: "int", nullable: false, comment: "菜单Id"),
                    ActionId = table.Column<int>(type: "int", nullable: true, comment: "操作Id")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_MenuAction", x => x.Id);
                },
                comment: "菜单按钮表");

            migrationBuilder.CreateTable(
                name: "t_MultPallet",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PalletBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "托盘号"),
                    WoodPalletBarcode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "木托盘号"),
                    Status = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "状态：0-待入库；1-已入库"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料编号"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料描述"),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id"),
                    OwnerName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货主"),
                    ProOrderNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "生产单号"),
                    ContractNO = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: true, comment: "合同号"),
                    Num = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "数量"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    OwnerCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_MultPallet", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_Owner",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "货主Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "货主编码"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "货主名称"),
                    AddrDetail = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true, comment: "地址"),
                    ZipCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "邮编"),
                    Contacts = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "联系人"),
                    MobilePhone = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "手机号"),
                    Email = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "邮箱"),
                    Status = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Owner", x => x.Id);
                },
                comment: "货主");

            migrationBuilder.CreateTable(
                name: "t_PackageDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "明细Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StackingStorageId = table.Column<int>(type: "int", nullable: true, comment: "垛存储Id"),
                    Status = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "状态：0-失效；1-生效"),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true, comment: "关联单详情Id"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料号"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    PackageClass = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "包装类型：1-容器；2-货品"),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true, comment: "物料关键字Id"),
                    BatchNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    QTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "数量"),
                    UnitId = table.Column<int>(type: "int", nullable: true, comment: "物料基本单位Id"),
                    UnitName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "物料基本单位"),
                    ConvertFigre = table.Column<int>(type: "int", nullable: true, comment: "收货最小单位与最小发货单位的转换因子：（收货除以发货单位）。计算公式为：通过物料的计量单位表中与基本单位转换"),
                    Barcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料条码：可以是容器条码或货品条码"),
                    PositionX = table.Column<int>(type: "int", nullable: true, comment: "该物料所在垛的X坐标：如果为最底层托盘则0"),
                    PositionY = table.Column<int>(type: "int", nullable: true, comment: "该物料所在垛的Y坐标：如果为最底层托盘则0"),
                    PositionZ = table.Column<int>(type: "int", nullable: true, comment: "该物料所在垛的Z坐标：如果为最底层托盘则0"),
                    LayerIndex = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "第几层包装：最外层为1"),
                    ParentId = table.Column<int>(type: "int", nullable: true, comment: "父包装Id"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "备注"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    PackageCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "包装条码"),
                    IsStocktake = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    HasSkuDetail = table.Column<bool>(type: "bit", nullable: false),
                    SkuNum = table.Column<decimal>(type: "decimal(18,3)", nullable: true),
                    BarcodeRange = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_PackageDetail", x => x.Id);
                },
                comment: "货品与包装关系表，容器与容器的关系，容器与货品的关系，货品与货品的关系等记录表");

            migrationBuilder.CreateTable(
                name: "t_Pallet",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PalletBarcode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: false, comment: "托盘条码"),
                    PalletName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "托盘名称"),
                    LocationCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "所在货位"),
                    Status = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "状态：0-禁用；1-启用"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "启用时间"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))"),
                    OPPrint = table.Column<int>(type: "int", nullable: false),
                    PrintTimes = table.Column<int>(type: "int", nullable: false),
                    LocationName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    ERPLocationName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    Type = table.Column<int>(type: "int", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Pallet", x => x.Id);
                },
                comment: "托盘");

            migrationBuilder.CreateTable(
                name: "t_PalletMoveRecord",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "托盘移动记录Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: false, comment: "订单Id"),
                    BillType = table.Column<int>(type: "int", nullable: false, comment: "单据类型"),
                    BusinessType = table.Column<int>(type: "int", nullable: true),
                    PalletBarcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: false, comment: "垛号"),
                    MoveInstructId = table.Column<int>(type: "int", nullable: false, comment: "移位指令Id"),
                    BackInstructId = table.Column<int>(type: "int", nullable: true, comment: "回原储位指令Id"),
                    StackingStorageId = table.Column<int>(type: "int", nullable: true, comment: "组垛Id"),
                    InventoryId = table.Column<int>(type: "int", nullable: false, comment: "库存Id"),
                    FromCellId = table.Column<int>(type: "int", nullable: false, comment: "原储位Id"),
                    FromCellCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "原储位编码"),
                    FromCellName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "原储位名称"),
                    FromCellLineNO = table.Column<int>(type: "int", nullable: false, comment: "原储位排号"),
                    FromCellLayerNO = table.Column<int>(type: "int", nullable: false, comment: "原储位层号"),
                    FromCellColumnNO = table.Column<int>(type: "int", nullable: false, comment: "原储位列号"),
                    FromCellDepthIndex = table.Column<int>(type: "int", nullable: false, comment: "原储位所在深度"),
                    MoveToCellId = table.Column<int>(type: "int", nullable: false, comment: "转移储位Id"),
                    MoveToCellCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "转移储位编码"),
                    MoveToCellName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "转移储位名称"),
                    MoveToCellLineNO = table.Column<int>(type: "int", nullable: false, comment: "转移储位排号"),
                    MoveToCellLayerNO = table.Column<int>(type: "int", nullable: false, comment: "转移储位层号"),
                    MoveToCellColumnNO = table.Column<int>(type: "int", nullable: false, comment: "转移储位列号"),
                    MoveToCellDepthIndex = table.Column<int>(type: "int", nullable: false, comment: "转移储位深度"),
                    BackToCellId = table.Column<int>(type: "int", nullable: true, comment: "返回储位Id"),
                    BackToCellCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "返回储位编码"),
                    BackToCellName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "返回储位名称"),
                    BackToCellLineNO = table.Column<int>(type: "int", nullable: true, comment: "返回储位排号"),
                    BackToCellLayerNO = table.Column<int>(type: "int", nullable: true, comment: "返回储位层号"),
                    BackToCellColumnNO = table.Column<int>(type: "int", nullable: true, comment: "返回储位列号"),
                    BackToCellDepthIndex = table.Column<int>(type: "int", nullable: true, comment: "返回储位深度"),
                    Status = table.Column<int>(type: "int", nullable: false, comment: "状态：0-转移中；1-已转移；2-返回中；3-已返回"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    MoveFinishedDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "转移完成时间"),
                    BackFinishedDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "返回完成时间"),
                    FromCellHeightType = table.Column<int>(type: "int", nullable: false),
                    MoveToCellHeightType = table.Column<int>(type: "int", nullable: false),
                    BackToCellHeightType = table.Column<int>(type: "int", nullable: true),
                    RealHeightType = table.Column<int>(type: "int", nullable: true, comment: "垛实际高度类型"),
                    RefCellCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    IsMultPallet = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_PalletMoveRecord", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_Path",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "路径Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Status = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "状态：0-禁用；1-启用"),
                    SrcWhId = table.Column<int>(type: "int", nullable: true, comment: "库房Id"),
                    DescWhId = table.Column<int>(type: "int", nullable: true, comment: "目标库房Id"),
                    SrcType = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "起始类型"),
                    DescType = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "目标类型"),
                    SrcAddr = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "起始地址"),
                    DescAddr = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "目标地址"),
                    Docks = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "停靠地址")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Path", x => x.Id);
                },
                comment: "路径表");

            migrationBuilder.CreateTable(
                name: "t_PickingOrder",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "下架单号"),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true, comment: "对应出库单明细Id"),
                    WarehouseCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "客户"),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房"),
                    BillType = table.Column<int>(type: "int", nullable: true, comment: "单据类型"),
                    LocationCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "仓位编码"),
                    LocationDepth = table.Column<int>(type: "int", nullable: true, comment: "仓位深度"),
                    StackingStorageId = table.Column<int>(type: "int", nullable: true, comment: "垛存储信息Id"),
                    PalletBarcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "垛条码"),
                    DescAddress = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "目标地址"),
                    Status = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "状态"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    QTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "数量"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料号"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id"),
                    OwnerName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货主名称"),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true, comment: "物料关键字Id"),
                    BatchNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "批次号"),
                    SourceType = table.Column<int>(type: "int", nullable: true, comment: "来源分类：1-入库；2-出库；3-移库；4-盘点")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_PickingOrder", x => x.Id);
                },
                comment: "下架单");

            migrationBuilder.CreateTable(
                name: "t_PickingOrderDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<int>(type: "int", nullable: true, comment: "上架单Id"),
                    PalletBarcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "垛条码"),
                    PackBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "包装条码"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料条码")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_PickingOrderDetail", x => x.Id);
                },
                comment: "下架单明细");

            migrationBuilder.CreateTable(
                name: "t_PickingStationData",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "拣选站台数据Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RelatedOrderId = table.Column<int>(type: "int", nullable: true, comment: "出库单Id"),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: false, comment: "出库单明细Id"),
                    PickingOutTaskId = table.Column<int>(type: "int", nullable: true, comment: "拣选出库任务Id"),
                    PickingOutInstructId = table.Column<int>(type: "int", nullable: true, comment: "拣选出库指令Id"),
                    PickingInTaskId = table.Column<int>(type: "int", nullable: true, comment: "拣选入库任务Id"),
                    PickingInInstructId = table.Column<int>(type: "int", nullable: true, comment: "拣选入库指令Id"),
                    OrderSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "出库单号"),
                    BatchNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "批次号"),
                    FromLocationCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "起始地址"),
                    FromLocationName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "起始地址名称"),
                    ToStationId = table.Column<int>(type: "int", nullable: true, comment: "目的站台Id"),
                    ToStationCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "目的站台地址"),
                    ToStationName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "目的站台名称"),
                    PalletBarcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "垛条码"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料编码"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id"),
                    OwnerName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "货主"),
                    SupplierId = table.Column<int>(type: "int", nullable: true, comment: "供应商Id"),
                    SupplierName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "供应商"),
                    TotalQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "当前库存总数"),
                    PickingQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "拣选数量"),
                    Status = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "状态：1-最新数据；0-过期数据"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    HasNotice = table.Column<bool>(type: "bit", nullable: false, comment: "是否已通知PDA"),
                    NoticeDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "通知时间"),
                    InventoryId = table.Column<int>(type: "int", nullable: true),
                    IsMultPallet = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    RefInvIds = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_PickingStationData", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_PickingStationDataDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PickingStationDataId = table.Column<int>(type: "int", nullable: true, comment: "拣选Id"),
                    StationId = table.Column<int>(type: "int", nullable: true, comment: "站台Id"),
                    StationCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "站台编码"),
                    PackageBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "包装条码"),
                    Barcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货品条码"),
                    SkuNum = table.Column<decimal>(type: "decimal(18,3)", nullable: true),
                    IsSku = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((1))"),
                    IsSelected = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    PickedNum = table.Column<int>(type: "int", nullable: true),
                    BarcodeRange = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_PickingStationDataDetail", x => x.Id);
                },
                comment: "拣选明细");

            migrationBuilder.CreateTable(
                name: "t_Platform",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: false, comment: "月台编码"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "月台名称"),
                    WhId = table.Column<int>(type: "int", nullable: false, comment: "库房Id"),
                    WhCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "库房编码"),
                    WhName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房名称"),
                    FunctionType = table.Column<int>(type: "int", nullable: false, comment: "功能类型：10-入库；20-出库；30-出入库"),
                    Status = table.Column<int>(type: "int", nullable: false, comment: "状态：0-禁用；1-正常"),
                    AddrFloor = table.Column<int>(type: "int", nullable: true, comment: "所在楼层"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Platform", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_PlatformSet",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "系统设置Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StrategyIdForIn = table.Column<int>(type: "int", nullable: true, comment: "当前入库策略Id"),
                    StrategyBusinessNameForIn = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: true, comment: "当前入库策略"),
                    StrategyIdForOut = table.Column<int>(type: "int", nullable: true, comment: "当前出库策略Id"),
                    StrategyBusinessNameForOut = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: true, comment: "当前出库策略"),
                    StrategyIdForStocktake = table.Column<int>(type: "int", nullable: true, comment: "当前盘点策略Id"),
                    StrategyBusinessNameForStocktake = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: true, comment: "当前盘点策略"),
                    LightMaterialTypeIds = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true, comment: "轻物料类型Id"),
                    HeavyMaterialTypeIds = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true, comment: "重物料类型Id"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    RoutewayMaxOutNum = table.Column<int>(type: "int", nullable: true),
                    IsReAllocation = table.Column<int>(type: "int", nullable: true),
                    SkipAudit = table.Column<int>(type: "int", nullable: true),
                    CurrMode = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "当前模式：0-无；1-入库模式；2-出库模式；3-盘点模式"),
                    WithYingXiao = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    ExecMinuteInterval = table.Column<int>(type: "int", nullable: true),
                    IsGetAll = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    IsPointSyncDate = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    PointSyncDate = table.Column<DateTime>(type: "datetime", nullable: true),
                    AllotOutStationMode = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))"),
                    CollectNow = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_PlatformSet", x => x.Id);
                },
                comment: "系统设置");

            migrationBuilder.CreateTable(
                name: "t_PutawayOrder",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "上架单Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "上架单号"),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true, comment: "对应收货单明细Id"),
                    BillType = table.Column<int>(type: "int", nullable: true, comment: "单据类型"),
                    StackingStorageId = table.Column<int>(type: "int", nullable: false, comment: "垛存储信息Id"),
                    PalletBarcode = table.Column<string>(type: "varchar(128)", unicode: false, maxLength: 128, nullable: true, comment: "垛条码"),
                    LocationCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "仓位编码"),
                    LocationDepth = table.Column<int>(type: "int", nullable: true, comment: "仓位深度"),
                    FIFODate = table.Column<DateTime>(type: "datetime", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "状态：1-创建；2-已确定；3-审核成功；4-上架中；5-已完成；"),
                    Volume = table.Column<int>(type: "int", nullable: true, comment: "体积"),
                    Weight = table.Column<int>(type: "int", nullable: true, comment: "重量"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "备注"),
                    QTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "数量"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料号"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id"),
                    OwnerName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货主名称"),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true, comment: "物料关键字Id"),
                    BatchNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "批次号"),
                    SourceType = table.Column<int>(type: "int", nullable: true, comment: "来源分类：1-入库；2-出库；3-移库；4-盘点"),
                    ParentPalletBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_PutawayOrder", x => x.Id);
                },
                comment: "上架单");

            migrationBuilder.CreateTable(
                name: "t_PutawayOrderDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "上架单明细Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PutawayOrderId = table.Column<int>(type: "int", nullable: true, comment: "上架单Id"),
                    PalletBarcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "垛条码"),
                    PackageBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "包装条码号"),
                    MaterialBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料条码")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_PutawayOrderDetail", x => x.Id);
                },
                comment: "上架单详情");

            migrationBuilder.CreateTable(
                name: "t_ReceivingBill",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BillNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "单号"),
                    SupplierId = table.Column<int>(type: "int", nullable: true, comment: "供应商Id"),
                    SupplierName = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true, comment: "供应商名称"),
                    Status = table.Column<int>(type: "int", nullable: false, comment: "状态：0-未开始；1-未完成；2-已完成"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    BeginDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "开始时间"),
                    EndDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "完成时间"),
                    RefSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "关联单号"),
                    Receiver = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "收货人"),
                    StoLocation = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库存地点"),
                    TotalQTY = table.Column<decimal>(type: "decimal(18,5)", nullable: true),
                    TotalCheckQTY = table.Column<decimal>(type: "decimal(18,5)", nullable: true),
                    CheckedQTY = table.Column<decimal>(type: "decimal(18,5)", nullable: true),
                    IsCreatedChecklist = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    CheckType = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))"),
                    CheckResult = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))"),
                    NGReason = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(12,2)", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_ReceivingBill", x => x.Id);
                },
                comment: "收货单");

            migrationBuilder.CreateTable(
                name: "t_ReceivingBillDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BillId = table.Column<int>(type: "int", nullable: false, comment: "关联单Id"),
                    BillNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "关联单号"),
                    BillLineNO = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "行号"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料编码"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料描述"),
                    MaterialTypeCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "物料类型编码"),
                    MaterialTypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料类型名称"),
                    QTY = table.Column<decimal>(type: "decimal(18,5)", nullable: false, comment: "数量"),
                    ReceivedQTY = table.Column<decimal>(type: "decimal(18,5)", nullable: false, comment: "收货数量"),
                    Status = table.Column<int>(type: "int", nullable: false, comment: "状态：0-未收货；1-已收货；"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ConfirmDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "确定时间"),
                    PurchaseOrderNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "采购单号"),
                    ProductDate = table.Column<DateTime>(type: "datetime", nullable: true),
                    SupplierId = table.Column<int>(type: "int", nullable: true),
                    SupplierName = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true),
                    OwnerName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    BatchNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    CheckedQTY = table.Column<decimal>(type: "decimal(18,5)", nullable: true),
                    NeedCheckQTY = table.Column<decimal>(type: "decimal(18,5)", nullable: true),
                    IsNeedQC = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    Price = table.Column<decimal>(type: "decimal(12,2)", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(12,2)", nullable: true),
                    BatchNoExplain = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true),
                    ProduceFactory = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    OutFactoryDate = table.Column<DateTime>(type: "datetime", nullable: true),
                    ExpireDate = table.Column<DateTime>(type: "datetime", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_ReceivingBillDetail", x => x.Id);
                },
                comment: "收货单明细");

            migrationBuilder.CreateTable(
                name: "t_ReceivingGoodsDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "货品明细Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Barcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货品条码"),
                    OrderDetailId = table.Column<int>(type: "int", nullable: false, comment: "订单详情Id"),
                    Status = table.Column<int>(type: "int", nullable: false, comment: "状态：0-未收货；1-已收货"),
                    PackageBarcode = table.Column<string>(type: "varchar(120)", unicode: false, maxLength: 120, nullable: true, comment: "预期货品的最外侧包装条码"),
                    PalletBarcode = table.Column<string>(type: "varchar(120)", unicode: false, maxLength: 120, nullable: true, comment: "预期货品所在垛的条码"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    IsSku = table.Column<bool>(type: "bit", nullable: false, defaultValueSql: "((1))"),
                    SkuNum = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))"),
                    WoodPalletBarcode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    BarcodeRange = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_ReceivingGoodsDetail", x => x.Id);
                },
                comment: "入库单货品明细");

            migrationBuilder.CreateTable(
                name: "t_ReceivingOrderDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "明细Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "入库单编号"),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    WarehouseCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "库房编码"),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房名称"),
                    AreaCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "库区编码"),
                    AreaName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库区名称"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料号"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    MaterialTypeCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "物料类型编码"),
                    MaterialTypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料类型"),
                    ReceivedQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "实际接收数量：为基本单位的数量"),
                    QTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "期待数量：即订单数量，为基本单位的数量"),
                    StackedQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "码垛完成的数量"),
                    PackagedQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "包装完成的数量"),
                    PackQTY = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "总包装数量"),
                    UnitId = table.Column<int>(type: "int", nullable: true, comment: "物料基本单位Id"),
                    UnitName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "物料基本单位"),
                    ERPCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "ERP物料号"),
                    BatchNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "批次号"),
                    ExpireDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "有效期"),
                    QADate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "质检日期"),
                    ProductDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "生产日期"),
                    ProduceFactory = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "生产厂家"),
                    SupplierId = table.Column<int>(type: "int", nullable: true, comment: "供应商Id"),
                    SupplierName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "供应商"),
                    OutFactoryDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "出厂日期"),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id"),
                    OwnerName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货主"),
                    InStarDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "最早入库时间"),
                    Remark = table.Column<string>(type: "varchar(300)", unicode: false, maxLength: 300, nullable: true, comment: "备注"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true),
                    QualityState = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "质量状态：0-待检；1-合格；2-不合格；"),
                    Status = table.Column<int>(type: "int", nullable: false, comment: "状态：0-新建;1-已启动;2-作业中;3-已完成;4-强制完成;5-暂停;6-失效；7-异常"),
                    MaterialImg = table.Column<string>(type: "varchar(255)", unicode: false, maxLength: 255, nullable: true),
                    LogicalPartCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "逻辑分区编码"),
                    LogicalPartName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "逻辑分区名称"),
                    MBLNR = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料凭证号"),
                    DeptCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "部门编码"),
                    DeptName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "部门名称"),
                    ContractNO = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: true, comment: "合同号"),
                    SourceType = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "单据来源类型：0-手动建单；1-ERP;2-MES;3-SAP"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    SubmitDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "提交时间"),
                    SubmitUserId = table.Column<int>(type: "int", nullable: true, comment: "提交人Id"),
                    SubmitUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "提交人"),
                    AuditUserId = table.Column<int>(type: "int", nullable: true, comment: "审核人Id"),
                    AuditUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "审核人"),
                    AuditDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "审核时间"),
                    MJAHR = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料凭证年度"),
                    ZEILE = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料凭证行项目"),
                    PurOrderNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "采购订单号"),
                    PurOrderLineNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "采购订单行号"),
                    PurOrderLineType = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "采购订单行项目类型：0-无；1-L外协；2-U转储;3-正常采购"),
                    ProOrderNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "生产订单号"),
                    OutOrderNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "外协需求跟踪号"),
                    RefInVoucherId = table.Column<int>(type: "int", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    ReceivingBillDetailId = table.Column<int>(type: "int", nullable: true),
                    ReceivingBillId = table.Column<int>(type: "int", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(12,2)", nullable: true),
                    Price = table.Column<decimal>(type: "decimal(12,2)", nullable: true),
                    BatchNoExplain = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_ReceivingOrderDetail", x => x.Id);
                },
                comment: "入库单明细");

            migrationBuilder.CreateTable(
                name: "t_Role",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RoleCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "角色编码"),
                    RoleName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "角色名称"),
                    Remark = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "备注"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: true, comment: "排序编号"),
                    Status = table.Column<int>(type: "int", nullable: true, comment: "状态：0-禁用；1-正常"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "创建人姓名"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "修改用户名称"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Role", x => x.Id);
                },
                comment: "角色表");

            migrationBuilder.CreateTable(
                name: "t_RoleMenuAction",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RoleId = table.Column<int>(type: "int", nullable: false, comment: "角色Id"),
                    MenuId = table.Column<int>(type: "int", nullable: false, comment: "菜单Id"),
                    ActionId = table.Column<int>(type: "int", nullable: true, comment: "操作Id"),
                    IsMobile = table.Column<bool>(type: "bit", nullable: true, comment: "是否PDA端")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_RoleMenuAction", x => x.Id);
                },
                comment: "角色菜单按钮权限表");

            migrationBuilder.CreateTable(
                name: "t_RoleWarehouse",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "自增Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WarehouseId = table.Column<int>(type: "int", nullable: false, comment: "仓库Id"),
                    RoleId = table.Column<int>(type: "int", nullable: false, comment: "角色Id"),
                    CreateUserId = table.Column<int>(type: "int", nullable: false, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: false, comment: "创建人姓名"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, comment: "创建时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "修改用户名称"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_RoleWarehouse", x => x.Id);
                },
                comment: "仓库权限");

            migrationBuilder.CreateTable(
                name: "t_Routeway",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: false, comment: "巷道编码"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "巷道名称"),
                    WhId = table.Column<int>(type: "int", nullable: false, comment: "库房Id"),
                    WhCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "库房编码"),
                    WhName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房名称"),
                    Number = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "排序号"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Routeway", x => x.Id);
                },
                comment: "巷道");

            migrationBuilder.CreateTable(
                name: "t_ScannedPackageDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Status = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))"),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true),
                    PalletBarcode = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    PackageBarcode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    OrderNO = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true),
                    Num = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true),
                    OrderLineNO = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_ScannedPackageDetail", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_ScheduledTask",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Title = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "名称"),
                    RecordType = table.Column<int>(type: "int", nullable: true, comment: "记录类型"),
                    RecordId = table.Column<int>(type: "int", nullable: true, comment: "记录Id"),
                    RefId = table.Column<int>(type: "int", nullable: true, comment: "关联Id"),
                    Data = table.Column<string>(type: "varchar(1000)", unicode: false, maxLength: 1000, nullable: true, comment: "命令内容"),
                    Status = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "状态：-1-执行失败;0-待执行；1-执行中；2-已完成；"),
                    FinishedDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "完成时间"),
                    Msg = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "描述"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WarehouseCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    Priority = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_ScheduledTask", x => x.Id);
                },
                comment: "定时任务");

            migrationBuilder.CreateTable(
                name: "t_Shelf",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: false, comment: "货架编码"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "货架名称"),
                    Number = table.Column<int>(type: "int", nullable: true, comment: "货架号"),
                    WhId = table.Column<int>(type: "int", nullable: false, comment: "库房Id"),
                    AreaId = table.Column<int>(type: "int", nullable: false, comment: "库区Id"),
                    AreaCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "库区编码"),
                    AreaName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "所属库区"),
                    Status = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "状态：0-禁用；1-正常"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "排序号"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人"),
                    WhName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    CellCount = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))"),
                    DisabledCellCount = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))"),
                    Depth = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "深度，1：单深位，2：俩深位，3：三深位，4：四深位，5：五深位"),
                    ShelfType = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "货架类型：1-轻型货架；2-重型货架"),
                    RoutewayId = table.Column<int>(type: "int", nullable: true, comment: "巷道Id")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Shelf", x => x.Id);
                },
                comment: "货架");

            migrationBuilder.CreateTable(
                name: "t_ShippingGoodsDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Barcode = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "货物条码"),
                    OrderDetailId = table.Column<int>(type: "int", nullable: true, comment: "出货明细表Id"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料Sn"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    Status = table.Column<int>(type: "int", nullable: true, comment: "状态"),
                    PackageBarcode = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: true, comment: "预期箱条码"),
                    PalletBarcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "预期栈板条码"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建日期"),
                    IsOut = table.Column<bool>(type: "bit", nullable: false),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_ShippingGoodsDetail", x => x.Id);
                },
                comment: "出库单货品明细");

            migrationBuilder.CreateTable(
                name: "t_ShippingLockCell",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<int>(type: "int", nullable: true, comment: "出库单Id"),
                    OrderDetailId = table.Column<int>(type: "int", nullable: true, comment: "出库单明细Id"),
                    InventoryId = table.Column<int>(type: "int", nullable: true, comment: "库存Id"),
                    CellId = table.Column<int>(type: "int", nullable: true, comment: "仓位Id"),
                    CellCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "仓位编码"),
                    CellName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "仓位名称"),
                    CellDepthIndex = table.Column<int>(type: "int", nullable: true, comment: "仓位深度"),
                    PalletBarcode = table.Column<string>(type: "varchar(128)", unicode: false, maxLength: 128, nullable: true, comment: "垛条码"),
                    WhId = table.Column<int>(type: "int", nullable: true, comment: "库Id"),
                    StackingStorageId = table.Column<int>(type: "int", nullable: true, comment: "组垛Id"),
                    OutQty = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "出库数量"),
                    InventoryQty = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "库存数量"),
                    LockIndex = table.Column<int>(type: "int", nullable: true, comment: "序号"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料编码"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true, comment: "物料批次Id"),
                    BatchNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "批次号"),
                    IsPicking = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))", comment: "是否拣选"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    RoutewayId = table.Column<int>(type: "int", nullable: true),
                    ParentPalletBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_ShippingLockCell", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_ShippingOrderDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    Proirity = table.Column<int>(type: "int", nullable: true, comment: "优先级:默认为0"),
                    Status = table.Column<int>(type: "int", nullable: false, comment: "状态：0-新建;1-已启动;2-作业中;3-已完成;4-强制完成;5-暂停;6-失效；7-异常"),
                    WarehouseCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "库房编码"),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房名称"),
                    AreaCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "库区编码"),
                    AreaName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库区名称"),
                    MaterialId = table.Column<int>(type: "int", nullable: false, comment: "物料ID"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料号，对应公共数据库中的物料主数据表,指定仓位出库的时候物料号允许为空"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    MaterialTypeCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    BatchNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "批次号"),
                    QualityState = table.Column<int>(type: "int", nullable: true),
                    UnitId = table.Column<int>(type: "int", nullable: true, comment: "计量单位编号"),
                    UnitName = table.Column<string>(type: "varchar(10)", unicode: false, maxLength: 10, nullable: true, comment: "计量单位名称"),
                    QTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "预期出货数量"),
                    StationId = table.Column<int>(type: "int", nullable: true, comment: "出库站台Id"),
                    StationName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "预期出库站台或站台组"),
                    ERPCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    PackQTY = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "包装数量"),
                    PickedQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "已经下架的数量"),
                    ShippedQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "已经出库完成的数量"),
                    FinshDate = table.Column<DateTime>(type: "date", nullable: true, comment: "订单完成日期"),
                    SourceType = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "单据来源类型：0-手动建单；1-ERP;2-MES;3-SAP"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建用户Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建用户名"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建日期"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户ID"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改用户"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改日期"),
                    SubmitUserId = table.Column<int>(type: "int", nullable: true, comment: "提交人Id"),
                    SubmitUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "提交人"),
                    SubmitDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "提交时间"),
                    AuditUserId = table.Column<int>(type: "int", nullable: true, comment: "审核人Id"),
                    AuditUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "审核人"),
                    AuditDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "审核时间"),
                    MBLNR = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料凭证号"),
                    MJAHR = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料凭证年度"),
                    ZEILE = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料凭证行项目"),
                    PurOrderNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "采购订单号"),
                    PurOrderLineNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "采购订单行号"),
                    PurOrderLineType = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "采购订单行项目类型：0-无；1-L外协；2-U转储;3-正常采购"),
                    ProOrderNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "生产订单号"),
                    DeptCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "部门编码"),
                    DeptName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "部门名称"),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id"),
                    OwnerName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货主"),
                    DisOrderNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "发货单号"),
                    DisOrderLineNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "发货单行号"),
                    RefOutVoucherId = table.Column<int>(type: "int", nullable: true),
                    RefDispatchOrderId = table.Column<int>(type: "int", nullable: true),
                    ContractNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    IsMultPallet = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    IsSuspend = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    IsOutOrderReview = table.Column<bool>(type: "bit", nullable: true),
                    IsOnceOut = table.Column<bool>(type: "bit", nullable: true),
                    OnceOutGroupGUID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    ProduceFactory = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    SupplierName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    SupplierId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_ShippingOrderDetail", x => x.Id);
                },
                comment: "出库单明细");

            migrationBuilder.CreateTable(
                name: "t_StackingStorage",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WarehouseCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房名称"),
                    AreaCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    AreaName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true, comment: "关联单详情Id"),
                    BillType = table.Column<int>(type: "int", nullable: true, comment: "单据类型Id"),
                    Status = table.Column<int>(type: "int", nullable: false, comment: "状态：0-失效；1-生效；"),
                    PalletBarcode = table.Column<string>(type: "varchar(128)", unicode: false, maxLength: 128, nullable: false, comment: "垛条码"),
                    SubTrayQTY = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "子托盘数，没有子托盘可以是0"),
                    PackQTY = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "包装数量/箱数量"),
                    QTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "货品数量"),
                    ExpectedLocation = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "预留分配的收货仓位"),
                    TotalLength = table.Column<int>(type: "int", nullable: true, comment: "垛总长：单位厘米"),
                    TotalWidth = table.Column<int>(type: "int", nullable: true, comment: "垛总宽：单位厘米"),
                    TotalHeight = table.Column<int>(type: "int", nullable: true, comment: "垛总高：单位厘米"),
                    TotalVolume = table.Column<int>(type: "int", nullable: true, comment: "垛体积：单位立方厘米"),
                    TotalWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "垛重量：单位千克"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "备注"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    FIFODate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "先入先出日期时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料编码"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: true, comment: "物料批次信息Id"),
                    BatchNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "批次号"),
                    CacheLocation = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    LogicalPartCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "所属逻辑分区编号"),
                    WoodPalletBarcode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    IsMultPallet = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    ParentPalletBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_StackingStorage", x => x.Id);
                },
                comment: "入库垛信息");

            migrationBuilder.CreateTable(
                name: "t_Station",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "站台编码"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "站台名称"),
                    DeviceCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "设备编码"),
                    WhId = table.Column<int>(type: "int", nullable: false, comment: "库房Id"),
                    WhCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "库房编码"),
                    WhName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房名称"),
                    AreaId = table.Column<int>(type: "int", nullable: true, comment: "库区Id"),
                    AreaName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库区名称"),
                    LEDId = table.Column<int>(type: "int", nullable: true, comment: "关联LED设备Id"),
                    StationSort = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "站台分类：1-轻型；2-重型"),
                    StationType = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))"),
                    FunctionType = table.Column<int>(type: "int", nullable: false, comment: "功能类型：1-入库；2-出库；3-出入库；4-拣选；5-缓存"),
                    Status = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "状态：0-禁用；1-正常"),
                    IsLock = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))", comment: "是否锁定"),
                    AddrFloor = table.Column<int>(type: "int", nullable: true, comment: "所在楼层"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "排序号"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Station", x => x.Id);
                },
                comment: "站台");

            migrationBuilder.CreateTable(
                name: "t_StationData",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StationId = table.Column<int>(type: "int", nullable: false, comment: "站台ID"),
                    StationCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "站台编码"),
                    PackageBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "包装条码"),
                    Barcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料条码"),
                    MaterialId = table.Column<int>(type: "int", nullable: false, comment: "物料Id"),
                    MaterialKeyId = table.Column<int>(type: "int", nullable: false, comment: "物料KeyID"),
                    BatchNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "批次号"),
                    Status = table.Column<int>(type: "int", nullable: false, comment: "状态：0-未到位；1-已到位未放行；2-已放行"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    FinishDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "放行时间"),
                    IsPickIn = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    IsStocktake = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    IsArrived = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    IsStackFinished = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_StationData", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_StationRouteway",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WhId = table.Column<int>(type: "int", nullable: true, comment: "库房Id"),
                    StationId = table.Column<int>(type: "int", nullable: true, comment: "站台Id"),
                    RoutewayId = table.Column<int>(type: "int", nullable: true, comment: "巷道Id"),
                    StationCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "站台编码"),
                    RoutewayCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "巷道编码")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_StationRouteway", x => x.Id);
                },
                comment: "站台巷道关联表");

            migrationBuilder.CreateTable(
                name: "t_StocktakeGoodsDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Barcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    PackageBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    PalletBarcode = table.Column<string>(type: "varchar(128)", unicode: false, maxLength: 128, nullable: true),
                    RelatedOrderId = table.Column<int>(type: "int", nullable: true),
                    RelatedOrderDetailId = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_StocktakeGoodsDetail", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_StocktakeResultGoodsDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StocktakeResultId = table.Column<int>(type: "int", nullable: true),
                    PackageBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    Barcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    SkuNum = table.Column<decimal>(type: "decimal(18,3)", nullable: true),
                    IsSku = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_StocktakeResultGoodsDetail", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_StocktakeResultRecord",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "盘点记录Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<int>(type: "int", nullable: false, comment: "订单Id"),
                    OrderSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "订单编码"),
                    WarehouseId = table.Column<int>(type: "int", nullable: false, comment: "库房Id"),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房"),
                    AreaId = table.Column<int>(type: "int", nullable: true, comment: "库区Id"),
                    AreaName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库区"),
                    BillTypeId = table.Column<int>(type: "int", nullable: true, comment: "单据类型Id"),
                    BillTypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "单据类型"),
                    CellId = table.Column<int>(type: "int", nullable: true, comment: "仓位Id"),
                    CellCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "仓位编码"),
                    CellDepthIndex = table.Column<int>(type: "int", nullable: true, comment: "仓位深度"),
                    PackageBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "包装条码：如料箱条码。整垛盘点为空（不拆箱盘点），否则不允许为空"),
                    PalletBarcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "垛条码"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    MaterialBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料条码"),
                    ScanBarcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "扫描条码"),
                    OriginalQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "原始数量"),
                    CountQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "盘点后数量"),
                    UnitId = table.Column<int>(type: "int", nullable: true, comment: "盘点单位Id"),
                    UnitName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "盘点单位：通常为物料的基本单位"),
                    IsHandle = table.Column<byte>(type: "tinyint", nullable: false, comment: "是否已处理"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "备注"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    Status = table.Column<int>(type: "int", nullable: true, comment: "盘点结果状态:1-盘平;2-盘盈;3-盘亏;")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_StocktakeResultRecord", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_StocktakingOrder",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "盘点订单Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "名称"),
                    OrderSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "订单号"),
                    WarehouseId = table.Column<int>(type: "int", nullable: false, comment: "库房Id"),
                    WarehouseCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房"),
                    AreaId = table.Column<int>(type: "int", nullable: true, comment: "库区Id"),
                    AreaCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    AreaName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库区"),
                    CompanyId = table.Column<int>(type: "int", nullable: true, comment: "公司Id"),
                    CompanyName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "公司名称"),
                    BillType = table.Column<int>(type: "int", nullable: true, comment: "单据类型Id"),
                    ERPCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "ERP单据类型编码"),
                    Status = table.Column<int>(type: "int", nullable: false, comment: "单据状态：0-创建;1-提交;2-审核通过;3-作业中；4-已完成;5-强制完成;6-失效；7-异常"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    BatchNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "批次号"),
                    PlanType = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((10))", comment: "盘点计划：10-普通抽盘；20-临时抽盘；30-紧急抽盘；40-货主抽盘；50-库区抽盘；"),
                    StocktakeWay = table.Column<int>(type: "int", nullable: false, comment: "盘点方法：0-全部盘点；10-不盘30天已盘点的库区；20-不盘15天已盘点的库区；30-不盘7天内已盘点的库区；"),
                    MaxLocationCount = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "单盘最大库位数"),
                    Granularity = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "盘点粒度：0-全部盘点；10-抽查盘点（5%库位）；20-抽查盘点（25%库位）；30-抽查盘点（50%库位）\r\n"),
                    CellCount = table.Column<int>(type: "int", nullable: false, comment: "库位数量"),
                    FinishedCount = table.Column<int>(type: "int", nullable: false, comment: "完成数量"),
                    TouchTimes = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "动碰次数"),
                    TouchStartDate = table.Column<DateTime>(type: "datetime", nullable: true),
                    TouchEndDate = table.Column<DateTime>(type: "datetime", nullable: true),
                    LoopTimes = table.Column<int>(type: "int", nullable: false, comment: "循环次数"),
                    PriorityLevel = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "优先级"),
                    ExecDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "盘点执行时间"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "备注"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    SubmitDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "提交时间"),
                    SubmitUserId = table.Column<int>(type: "int", nullable: true, comment: "提交人Id"),
                    SubmitUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "提交人"),
                    AuditDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "审核时间"),
                    AuditUserId = table.Column<int>(type: "int", nullable: true, comment: "审核人Id"),
                    AuditUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "审核人")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_StocktakingOrder", x => x.Id);
                },
                comment: "盘点单");

            migrationBuilder.CreateTable(
                name: "t_StocktakingOrderDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "订单明细主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<int>(type: "int", nullable: false, comment: "盘点单Id"),
                    OrderSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "盘点单号"),
                    CellId = table.Column<int>(type: "int", nullable: true, comment: "仓位Id"),
                    CellCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "仓位编码"),
                    CellDepthIndex = table.Column<int>(type: "int", nullable: true),
                    PalletBarcode = table.Column<string>(type: "varchar(128)", unicode: false, maxLength: 128, nullable: true, comment: "垛条码"),
                    ExpectedStationIds = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true, comment: "预期站台"),
                    Status = table.Column<int>(type: "int", nullable: false, comment: "状态：0-创建、1-进行中、2-完成、3-已取消"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料号"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    HasSkuDetail = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))", comment: "是否有货号详情"),
                    QTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "数量"),
                    QualityState = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "质量状态：0-待检；1-合格；2-不合格；"),
                    BatchNO = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id"),
                    OwnerName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货主"),
                    ExpireDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "有效时间"),
                    ProductDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "生产日期"),
                    SupplierId = table.Column<int>(type: "int", nullable: true, comment: "供应商Id"),
                    SupplierName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "供应商"),
                    MaterialTypeId = table.Column<int>(type: "int", nullable: true, comment: "物料类型Id"),
                    MaterialTypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料类型"),
                    Step = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "当前步骤：0-未执行；1-出进行中；2-出完成；3-入进行中；4-入完成"),
                    IsNeedMove = table.Column<bool>(type: "bit", nullable: true, defaultValueSql: "((0))"),
                    InventoryId = table.Column<int>(type: "int", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_StocktakingOrderDetail", x => x.Id);
                },
                comment: "盘点明细");

            migrationBuilder.CreateTable(
                name: "t_StocktakingPlan",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BillSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "计划单号"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "计划名称"),
                    BeginDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "盘点计划开始时间"),
                    EndDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "盘点计划结束时间"),
                    WarehouseId = table.Column<int>(type: "int", nullable: true, comment: "库房Id"),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房"),
                    AreaId = table.Column<int>(type: "int", nullable: true, comment: "库区Id"),
                    AreaName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库区\r\n"),
                    Status = table.Column<int>(type: "int", nullable: true, comment: "状态：0-新建;10-已审核;20-已生成盘点单；30-取消作废；"),
                    PlanType = table.Column<int>(type: "int", nullable: true, comment: "盘点计划：10-普通抽盘；20-临时抽盘；30-紧急抽盘；40-货主抽盘；50-库区抽盘；\r\n"),
                    Repeat = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "重复盘点：0-全部盘点；10-不盘30天已盘点的库区；20-不盘15天已盘点的库区；30-不盘7天内已盘点的库区；"),
                    Means = table.Column<int>(type: "int", nullable: true, comment: "盘点工具：10-机器盘点；20-PDA；30-纸质；40-自定义；\r\n"),
                    MaxLocationCount = table.Column<int>(type: "int", nullable: true, comment: "单盘最大库位数\r\n"),
                    Granularity = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "盘点粒度：0-全部盘点；10-抽查盘点（5%库位）；20-抽查盘点（25%库位）；30-抽查盘点（50%库位）"),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id"),
                    OwnerName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货主"),
                    GoodsABC = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "货品ABC流通选项：0-A;1-B;2-C；可多选，逗号隔开"),
                    GoodsIds = table.Column<string>(type: "varchar(1000)", unicode: false, maxLength: 1000, nullable: true, comment: "指定货品Id,多个逗号隔开"),
                    GoodsNames = table.Column<string>(type: "nvarchar(3000)", maxLength: 3000, nullable: true, comment: "指定货品名称"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "备注"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建人"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_StocktakingPlan", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_StocktakingStrategy",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BillSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "计划单号"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "策略名称"),
                    WarehouseId = table.Column<int>(type: "int", nullable: true, comment: "库房Id"),
                    WarehouseName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房"),
                    AreaId = table.Column<int>(type: "int", nullable: true, comment: "库区Id"),
                    AreaName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库区\r\n"),
                    ExecCycle = table.Column<int>(type: "int", nullable: true, comment: "周期:0-每天执行一次；10-每7天执行一次；20-每15天执行一次；30-每月执行一次；"),
                    FirstExecBeginDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "计划第一次执行开始时间"),
                    FirstExecEndDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "计划第一次执行结束时间"),
                    EffectBeginDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "策略生效开始时间"),
                    EffectEndDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "策略生效结束时间"),
                    Status = table.Column<int>(type: "int", nullable: true, comment: "状态：1-启用；0-禁用；"),
                    PlanType = table.Column<int>(type: "int", nullable: true, comment: "盘点计划：10-普通抽盘；20-临时抽盘；30-紧急抽盘；40-货主抽盘；50-库区抽盘；\r\n"),
                    Repeat = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "重复盘点：0-全部盘点；10-不盘30天已盘点的库区；20-不盘15天已盘点的库区；30-不盘7天内已盘点的库区；"),
                    Means = table.Column<int>(type: "int", nullable: true, comment: "盘点工具：10-机器盘点；20-PDA；30-纸质；40-自定义；\r\n"),
                    MaxLocationCount = table.Column<int>(type: "int", nullable: true, comment: "单盘最大库位数\r\n"),
                    Granularity = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "盘点粒度：0-全部盘点；10-抽查盘点（5%库位）；20-抽查盘点（25%库位）；30-抽查盘点（50%库位）"),
                    OwnerId = table.Column<int>(type: "int", nullable: true, comment: "货主Id"),
                    OwnerName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "货主"),
                    GoodsABC = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "货品ABC流通选项：0-A;1-B;2-C；可多选，逗号隔开"),
                    GoodsIds = table.Column<string>(type: "varchar(1000)", unicode: false, maxLength: 1000, nullable: true, comment: "指定货品Id,多个逗号隔开"),
                    GoodsNames = table.Column<string>(type: "nvarchar(3000)", maxLength: 3000, nullable: true, comment: "指定货品名称"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "备注"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建人"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_StocktakingStrategy", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_Strategy",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "策略Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "策略名称"),
                    BusinessClassName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "业务类"),
                    StrategyType = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "策略类型：1-入库策略；2-出库策略"),
                    IsEnable = table.Column<bool>(type: "bit", nullable: false, defaultValueSql: "((1))", comment: "是否启用"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "序号"),
                    IsUsed = table.Column<bool>(type: "bit", nullable: false, comment: "是否当前在应用"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Strategy", x => x.Id);
                },
                comment: "策略表");

            migrationBuilder.CreateTable(
                name: "t_Supplier",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: false, comment: "供应商编码"),
                    Name = table.Column<string>(type: "varchar(60)", unicode: false, maxLength: 60, nullable: false, comment: "供应商名称"),
                    TypeId = table.Column<int>(type: "int", nullable: false, comment: "分类Id:对应字典项Id"),
                    TypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "分类名称：对应字典项名称"),
                    AddrDetail = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true, comment: "供应商地址"),
                    Contact = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "联系人"),
                    ContactMobile = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "联系电话"),
                    Contact1 = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "联系人1"),
                    Contact1Mobile = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "联系人1电话"),
                    Email = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "邮箱"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "排序号"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建用户Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建用户名"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "创建用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建用户名称")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Supplier", x => x.Id);
                },
                comment: "供货商");

            migrationBuilder.CreateTable(
                name: "t_TaskManage",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Typename = table.Column<string>(type: "varchar(150)", unicode: false, maxLength: 150, nullable: true),
                    Tasktype = table.Column<int>(type: "int", nullable: true),
                    Taskcode = table.Column<string>(type: "varchar(150)", unicode: false, maxLength: 150, nullable: true),
                    vessel = table.Column<string>(type: "varchar(150)", unicode: false, maxLength: 150, nullable: true),
                    startseat = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    endseat = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    startnode = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    endnode = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    suppliesnode = table.Column<string>(type: "varchar(150)", unicode: false, maxLength: 150, nullable: true),
                    suppliesname = table.Column<string>(type: "varchar(150)", unicode: false, maxLength: 150, nullable: true),
                    sturat = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true),
                    Number = table.Column<int>(type: "int", nullable: true),
                    barCode = table.Column<string>(type: "varchar(150)", unicode: false, maxLength: 150, nullable: true),
                    batchNo = table.Column<string>(type: "varchar(150)", unicode: false, maxLength: 150, nullable: true),
                    tnode = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_TaskManage", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_TaskStock",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Stockcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "盘点单编号"),
                    suppliesnode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料编号"),
                    suppliesname = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    Areanode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "库口"),
                    sturat = table.Column<int>(type: "int", nullable: true, comment: "任务状态  1 进行中 2完成 "),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
                    CreateUserName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "创建人")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_TaskStock", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_TaskStockDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Stockcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "盘点单编号"),
                    suppliesnode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料编号"),
                    suppliesname = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    barCode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "托盘码"),
                    Cellcode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "仓位编号"),
                    Number = table.Column<int>(type: "int", nullable: true, comment: "数量"),
                    Areanode = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "库口"),
                    sturat = table.Column<int>(type: "int", nullable: true, comment: "状态 0未出 1盘点中 2完成"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
                    CreateUserName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "创建人")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_TaskStockDetail", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_TransferBinGoodsDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<int>(type: "int", nullable: true, comment: "移库单Id"),
                    OrderDetailId = table.Column<int>(type: "int", nullable: true, comment: "移库明细ID"),
                    OrderSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库单号"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物料ID"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    Status = table.Column<int>(type: "int", nullable: true, comment: "物流状态"),
                    PackageBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物流外包装条码"),
                    PalletBarcode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料堆放栈板条码"),
                    Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_TransferBinGoodsDetail", x => x.Id);
                },
                comment: "移库物料明细");

            migrationBuilder.CreateTable(
                name: "t_TransferBinOrder",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库订单编号：Move+年月+00001"),
                    BillType = table.Column<int>(type: "int", nullable: true, comment: "单据类型编号"),
                    Status = table.Column<int>(type: "int", nullable: true, comment: "单据状态：0-创建;1-提交;2-审核通过;3-作业中；4-已完成;5-强制完成;6-失效；7-异常"),
                    SourceType = table.Column<int>(type: "int", nullable: true, comment: "来源类型:默认为1(手动建单)，对应中间库的表T_BD_BillSource"),
                    CompanyId = table.Column<int>(type: "int", nullable: true, comment: "公司Id"),
                    CompanyName = table.Column<string>(type: "varchar(128)", unicode: false, maxLength: 128, nullable: true, comment: "公司名称"),
                    Proirity = table.Column<int>(type: "int", nullable: true, comment: "优先级:默认为0"),
                    ERPCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "客户单据号"),
                    Reason = table.Column<string>(type: "text", nullable: true, comment: "调整原因"),
                    Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人ID"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建日期"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    SubmitUserId = table.Column<int>(type: "int", nullable: true, comment: "提交人Id"),
                    SubmitUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "提交人"),
                    SubmitDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "提交时间"),
                    AuditUserId = table.Column<int>(type: "int", nullable: true, comment: "审核人Id"),
                    AuditUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "审核人"),
                    AuditDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "审核时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_TransferBinOrder", x => x.Id);
                },
                comment: "移库单表");

            migrationBuilder.CreateTable(
                name: "t_TransferBinOrderDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<int>(type: "int", nullable: true, comment: "移库单表Id"),
                    OrderSn = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库单编号"),
                    MaterialId = table.Column<int>(type: "int", nullable: true, comment: "物流ID"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    FromWhId = table.Column<int>(type: "int", nullable: true, comment: "移库前库房Id"),
                    FromWhName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库前库房名称"),
                    FromWhCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库前库房编码"),
                    FromRegionId = table.Column<int>(type: "int", nullable: true, comment: "移库前库房区域ID"),
                    FromRegionName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库前库房区域名称"),
                    FromRegionCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库前逻辑分区：为逻辑分区编码，对应中间库T_SM_Region表的主键"),
                    FromLocationId = table.Column<int>(type: "int", nullable: true, comment: "移库前库位ID"),
                    FromLocationName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库前库位名称"),
                    FromLocationCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库前仓位编码"),
                    ToWhId = table.Column<int>(type: "int", nullable: true, comment: "移库后库房ID"),
                    ToWhName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库后库房名称"),
                    ToWhCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库后库房编码"),
                    ToRegionId = table.Column<int>(type: "int", nullable: true, comment: "移库后库房区域ID"),
                    ToRegionName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库后库房区域名称"),
                    ToRegionCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库后逻辑分区：为逻辑分区编码"),
                    ToLocationId = table.Column<int>(type: "int", nullable: true, comment: "移库后库位ID"),
                    ToLocationName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库后库位名称"),
                    ToLocationCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库后仓位编码"),
                    ExpectedStackingQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "期望移库的垛数:立库必须整垛移库"),
                    ActualStackingQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, comment: "实际完成移库的垛数:立库会存在无法移库的情况，平库不存在"),
                    Quantity = table.Column<int>(type: "int", nullable: true, comment: "调仓货品数量:立库则是该垛下物料总数量，平库则是人工需要拣货移库的数量（不一定是整箱移）"),
                    IsFullStackingProirity = table.Column<bool>(type: "bit", nullable: true, comment: "是否满垛优先移库:Y优先满垛移库、N优先不满垛移库"),
                    ExceptionCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "移库订单执行的异常编码"),
                    ExceptionText = table.Column<string>(type: "text", nullable: true, comment: "移库订单执行的异常文本"),
                    Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人ID"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改人ID"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    Status = table.Column<int>(type: "int", nullable: true, comment: "单据状态：0-创建;1-提交;2-审核通过;3-作业中；4-已完成;5-强制完成;6-失效；7-异常"),
                    FilterType = table.Column<int>(type: "int", nullable: true),
                    ToLogicalPartCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    IsPriorityFilling = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_TransferBinOrderDetail", x => x.Id);
                },
                comment: "移库单明细");

            migrationBuilder.CreateTable(
                name: "t_UnitConvertFigre",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialId = table.Column<int>(type: "int", nullable: false, comment: "物料Id"),
                    MaterialCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "物料编码"),
                    MaterialName = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "物料名称"),
                    BaseUnitId = table.Column<int>(type: "int", nullable: true, comment: "基本单位Id"),
                    BaseUnitName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "基本单位"),
                    UnitId = table.Column<int>(type: "int", nullable: false, comment: "包装单位ID"),
                    UnitName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "包装单位"),
                    Numerator = table.Column<int>(type: "int", nullable: true, comment: "转换分子"),
                    Denominator = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((1))", comment: "转换为基本计量单位的分母 ，默认值为1")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_UnitConvertFigre", x => x.Id);
                },
                comment: "物料的计量单位转换");

            migrationBuilder.CreateTable(
                name: "t_UnstackData",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "ID")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderId = table.Column<int>(type: "int", nullable: true, comment: "单据ID"),
                    OrderDetailId = table.Column<int>(type: "int", nullable: true, comment: "单据明细ID"),
                    StationCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "站点代码"),
                    UnstackType = table.Column<int>(type: "int", nullable: true, comment: "拆盘类型：0-整箱出库；1-拣选出库；"),
                    PackageCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "箱条码"),
                    MaterialCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "物料编码"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "生成日期"),
                    TaskId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_UnstackData", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_User",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UserName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "用户名"),
                    RealName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "真实姓名"),
                    Pwd = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "密码"),
                    HeadShot = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "头像"),
                    Status = table.Column<int>(type: "int", nullable: true, comment: "状态"),
                    Gender = table.Column<int>(type: "int", nullable: true, comment: "性别：1-男；2-女"),
                    MobilePhone = table.Column<string>(type: "varchar(11)", unicode: false, maxLength: 11, nullable: true, comment: "手机号"),
                    Email = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "邮箱"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "备注"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建用户Id"),
                    CreateUserName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "创建用户名"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "修改用户名"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    JobNO = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true),
                    Signature = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    UserSecret = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    IsModifyPwd = table.Column<bool>(type: "bit", nullable: true),
                    DepartmentId = table.Column<int>(type: "int", nullable: true),
                    IsSeeOnlySelfData = table.Column<bool>(type: "bit", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_User", x => x.Id);
                },
                comment: "用户表");

            migrationBuilder.CreateTable(
                name: "t_UserRole",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "用户角色Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UserId = table.Column<int>(type: "int", nullable: false, comment: "用户Id"),
                    RoleId = table.Column<int>(type: "int", nullable: false, comment: "角色Id")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_UserRole", x => x.Id);
                },
                comment: "用户角色表");

            migrationBuilder.CreateTable(
                name: "t_Warehouse",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: false, comment: "库房编码"),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "库房名称"),
                    TypeId = table.Column<int>(type: "int", nullable: true, comment: "库房类型Id"),
                    TypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "库房类型名称"),
                    ERPCode = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "对应ERP系统的库房编码"),
                    Status = table.Column<int>(type: "int", nullable: false, defaultValueSql: "((1))", comment: "状态：0-禁用；1-正常"),
                    Contact = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "联系人"),
                    MobilePhone = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "联系电话"),
                    AddrDetail = table.Column<string>(type: "varchar(100)", unicode: false, maxLength: 100, nullable: true, comment: "地址"),
                    BuiltArea = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "库房面积"),
                    Remark = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "备注"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())", comment: "创建时间"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建人"),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true, comment: "修改用户Id"),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改人"),
                    AreaCount = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))"),
                    StationCount = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))"),
                    RoutewayCount = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))"),
                    IsMain = table.Column<bool>(type: "bit", nullable: true),
                    MapCode = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_Warehouse", x => x.Id);
                },
                comment: "库房");

            migrationBuilder.CreateTable(
                name: "t_WaveOrder",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderSN = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    WaveType = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))"),
                    StartTime = table.Column<DateTime>(type: "datetime", nullable: true),
                    EndTime = table.Column<DateTime>(type: "datetime", nullable: true),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())"),
                    ModifyUserId = table.Column<int>(type: "int", nullable: true),
                    ModifyUserName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_WaveOrder", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "t_WorkDocument",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "作业文档Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WhId = table.Column<int>(type: "int", nullable: true, comment: "库房Id"),
                    Status = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "作业状态：0-待作业、1-作业中、2-已上架；3-已下架、4-已分拣；5-已完成"),
                    RelatedOrderId = table.Column<int>(type: "int", nullable: true, comment: "入库单Id"),
                    BillTypeId = table.Column<int>(type: "int", nullable: true, comment: "单据类型Id"),
                    BillTypeName = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "单据类型"),
                    ERPBillTypeCode = table.Column<string>(type: "varchar(30)", unicode: false, maxLength: 30, nullable: true, comment: "外部ERP单据类型编码"),
                    PlanQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "计划数量"),
                    AllocateQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "分配数量"),
                    PickedQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "下架完数量"),
                    PutawayQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "上架完数量"),
                    SortedQTY = table.Column<decimal>(type: "decimal(18,3)", nullable: true, defaultValueSql: "((0))", comment: "已分拣数量，或配料的数量"),
                    PrintTimes = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "打印次数"),
                    StartTime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "开始时间"),
                    EndTime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "结束时间"),
                    WorkLocation = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "工作地点，一般为出入库月台"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, defaultValueSql: "(getdate())", comment: "创建日期")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_WorkDocument", x => x.Id);
                },
                comment: "作业文档");

            migrationBuilder.CreateTable(
                name: "temp",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false),
                    Name = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, comment: "分类名称"),
                    Remark = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "备注"),
                    CreateUserId = table.Column<int>(type: "int", nullable: true, comment: "创建人Id"),
                    CreateUserName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "创建人姓名"),
                    CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
                    UpdateUserId = table.Column<int>(type: "int", nullable: true, comment: "更新人Id"),
                    UpdateUserName = table.Column<string>(type: "varchar(20)", unicode: false, maxLength: 20, nullable: true, comment: "更新人姓名"),
                    UpdateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "更新时间"),
                    ParentId = table.Column<int>(type: "int", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: true),
                    Code = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_temp", x => x.Id);
                },
                comment: "物料分类表");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "t_Action");

            migrationBuilder.DropTable(
                name: "t_AgvInstruct");

            migrationBuilder.DropTable(
                name: "t_Area");

            migrationBuilder.DropTable(
                name: "t_AreaOpen");

            migrationBuilder.DropTable(
                name: "t_AuditRecord");

            migrationBuilder.DropTable(
                name: "t_BarCodeRules");

            migrationBuilder.DropTable(
                name: "t_CachePort");

            migrationBuilder.DropTable(
                name: "t_Carrier");

            migrationBuilder.DropTable(
                name: "t_Cell");

            migrationBuilder.DropTable(
                name: "t_Company");

            migrationBuilder.DropTable(
                name: "t_Customer");

            migrationBuilder.DropTable(
                name: "t_Department");

            migrationBuilder.DropTable(
                name: "t_DepartmentOwner");

            migrationBuilder.DropTable(
                name: "t_Device");

            migrationBuilder.DropTable(
                name: "t_DictItem");

            migrationBuilder.DropTable(
                name: "t_DictType");

            migrationBuilder.DropTable(
                name: "t_DisasterLevel");

            migrationBuilder.DropTable(
                name: "t_DisasterMaterial");

            migrationBuilder.DropTable(
                name: "t_ErrorLog");

            migrationBuilder.DropTable(
                name: "t_Instruct");

            migrationBuilder.DropTable(
                name: "t_InterfaceLog");

            migrationBuilder.DropTable(
                name: "t_Inventory");

            migrationBuilder.DropTable(
                name: "t_InventoryAdjust");

            migrationBuilder.DropTable(
                name: "t_InventoryDetail");

            migrationBuilder.DropTable(
                name: "t_InventoryLog");

            migrationBuilder.DropTable(
                name: "t_InventoryPallet");

            migrationBuilder.DropTable(
                name: "t_Inventoryst");

            migrationBuilder.DropTable(
                name: "t_Location");

            migrationBuilder.DropTable(
                name: "t_Log");

            migrationBuilder.DropTable(
                name: "t_Material");

            migrationBuilder.DropTable(
                name: "t_MaterialBarcode");

            migrationBuilder.DropTable(
                name: "t_MaterialCategory");

            migrationBuilder.DropTable(
                name: "t_MaterialExtData");

            migrationBuilder.DropTable(
                name: "t_MaterialExtField");

            migrationBuilder.DropTable(
                name: "t_MaterialGroup");

            migrationBuilder.DropTable(
                name: "t_MaterialKey");

            migrationBuilder.DropTable(
                name: "t_MaterialPackage");

            migrationBuilder.DropTable(
                name: "t_MaterialWiki");

            migrationBuilder.DropTable(
                name: "t_MaterialWikiFile");

            migrationBuilder.DropTable(
                name: "t_Menu");

            migrationBuilder.DropTable(
                name: "t_MenuAction");

            migrationBuilder.DropTable(
                name: "t_MultPallet");

            migrationBuilder.DropTable(
                name: "t_Owner");

            migrationBuilder.DropTable(
                name: "t_PackageDetail");

            migrationBuilder.DropTable(
                name: "t_Pallet");

            migrationBuilder.DropTable(
                name: "t_PalletMoveRecord");

            migrationBuilder.DropTable(
                name: "t_Path");

            migrationBuilder.DropTable(
                name: "t_PickingOrder");

            migrationBuilder.DropTable(
                name: "t_PickingOrderDetail");

            migrationBuilder.DropTable(
                name: "t_PickingStationData");

            migrationBuilder.DropTable(
                name: "t_PickingStationDataDetail");

            migrationBuilder.DropTable(
                name: "t_Platform");

            migrationBuilder.DropTable(
                name: "t_PlatformSet");

            migrationBuilder.DropTable(
                name: "t_PutawayOrder");

            migrationBuilder.DropTable(
                name: "t_PutawayOrderDetail");

            migrationBuilder.DropTable(
                name: "t_ReceivingBill");

            migrationBuilder.DropTable(
                name: "t_ReceivingBillDetail");

            migrationBuilder.DropTable(
                name: "t_ReceivingGoodsDetail");

            migrationBuilder.DropTable(
                name: "t_ReceivingOrderDetail");

            migrationBuilder.DropTable(
                name: "t_Role");

            migrationBuilder.DropTable(
                name: "t_RoleMenuAction");

            migrationBuilder.DropTable(
                name: "t_RoleWarehouse");

            migrationBuilder.DropTable(
                name: "t_Routeway");

            migrationBuilder.DropTable(
                name: "t_ScannedPackageDetail");

            migrationBuilder.DropTable(
                name: "t_ScheduledTask");

            migrationBuilder.DropTable(
                name: "t_Shelf");

            migrationBuilder.DropTable(
                name: "t_ShippingGoodsDetail");

            migrationBuilder.DropTable(
                name: "t_ShippingLockCell");

            migrationBuilder.DropTable(
                name: "t_ShippingOrderDetail");

            migrationBuilder.DropTable(
                name: "t_StackingStorage");

            migrationBuilder.DropTable(
                name: "t_Station");

            migrationBuilder.DropTable(
                name: "t_StationData");

            migrationBuilder.DropTable(
                name: "t_StationRouteway");

            migrationBuilder.DropTable(
                name: "t_StocktakeGoodsDetail");

            migrationBuilder.DropTable(
                name: "t_StocktakeResultGoodsDetail");

            migrationBuilder.DropTable(
                name: "t_StocktakeResultRecord");

            migrationBuilder.DropTable(
                name: "t_StocktakingOrder");

            migrationBuilder.DropTable(
                name: "t_StocktakingOrderDetail");

            migrationBuilder.DropTable(
                name: "t_StocktakingPlan");

            migrationBuilder.DropTable(
                name: "t_StocktakingStrategy");

            migrationBuilder.DropTable(
                name: "t_Strategy");

            migrationBuilder.DropTable(
                name: "t_Supplier");

            migrationBuilder.DropTable(
                name: "t_TaskManage");

            migrationBuilder.DropTable(
                name: "t_TaskStock");

            migrationBuilder.DropTable(
                name: "t_TaskStockDetail");

            migrationBuilder.DropTable(
                name: "t_TransferBinGoodsDetail");

            migrationBuilder.DropTable(
                name: "t_TransferBinOrder");

            migrationBuilder.DropTable(
                name: "t_TransferBinOrderDetail");

            migrationBuilder.DropTable(
                name: "t_UnitConvertFigre");

            migrationBuilder.DropTable(
                name: "t_UnstackData");

            migrationBuilder.DropTable(
                name: "t_User");

            migrationBuilder.DropTable(
                name: "t_UserRole");

            migrationBuilder.DropTable(
                name: "t_Warehouse");

            migrationBuilder.DropTable(
                name: "t_WaveOrder");

            migrationBuilder.DropTable(
                name: "t_WorkDocument");

            migrationBuilder.DropTable(
                name: "temp");
        }
    }
}
